<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Administration/main.master"
    CodeFile="ManufacturerDetails.aspx.cs" Inherits="Tathata.Web.Administration.Administration_ManufacturerDetails" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register TagPrefix="nopCommerce" TagName="NumericTextBox" Src="Modules/NumericTextBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="SimpleTextBox" Src="Modules/SimpleTextBox.ascx" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="c1" ContentPlaceHolderID="cph1" runat="Server">
    <div>
        <ajaxToolkit:TabContainer runat="server" ID="ManufacturerTabs" ActiveTabIndex="0">
            <ajaxToolkit:TabPanel runat="server" ID="pnlManufacturerInfo" HeaderText="Manufacturer Info">
                <ContentTemplate>
                    <table class="adminContent">
                        <tr>
                            <td class="adminTitle">
                                Name:
                            </td>
                            <td class="adminData">
                                <nopCommerce:SimpleTextBox runat="server" ID="txtName" CssClass="adminInput" ErrorMessage="Name is required">
                                </nopCommerce:SimpleTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Image:
                            </td>
                            <td class="adminData">
                                <asp:Image ID="iManufacturerPicture" runat="server" />
                                <br />
                                <asp:Button ID="btnRemoveManufacturerImage" CssClass="adminButton" CausesValidation="false"
                                    runat="server" Text="Remove image" OnClick="btnRemoveManufacturerImage_Click"
                                    Visible="false" />
                                <br />
                                <asp:FileUpload ID="fuManufacturerPicture" CssClass="adminInput" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Description:
                            </td>
                            <td class="adminData">
                                <fckeditorv2:fckeditor id="txtDescription" runat="server" basepath="~/fckeditor/"
                                    autodetectlanguage="false" height="350" width="800px">
                                </fckeditorv2:fckeditor>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Template:
                            </td>
                            <td class="adminData">
                                <asp:DropDownList ID="ddlTemplate" AutoPostBack="False" CssClass="adminInput" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Published:
                            </td>
                            <td class="adminData">
                                <asp:CheckBox ID="cbPublished" runat="server" Checked="True"></asp:CheckBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Display order:
                            </td>
                            <td class="adminData">
                                <nopCommerce:NumericTextBox runat="server" ID="txtDisplayOrder" CssClass="adminInput"
                                    RequiredErrorMessage="Display order is required" RangeErrorMessage="The value must be from -99999 to 99999"
                                    MinimumValue="-99999" MaximumValue="99999"></nopCommerce:NumericTextBox>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel runat="server" ID="pnlManufacturerSEO" HeaderText="SEO">
                <ContentTemplate>
                    <table class="adminContent">
                        <tr>
                            <td class="adminTitle">
                                Meta keywords:
                            </td>
                            <td class="adminData">
                                <asp:TextBox ID="txtMetaKeywords" CssClass="adminInput" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Meta description:
                            </td>
                            <td class="adminData">
                                <asp:TextBox ID="txtMetaDescription" CssClass="adminInput" runat="server" TextMode="MultiLine"
                                    Height="100"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="adminTitle">
                                Meta title:
                            </td>
                            <td class="adminData">
                                <asp:TextBox ID="txtMetaTitle" runat="server" CssClass="adminInput"></asp:TextBox>
                            </td>
                        </tr>
                        <tr runat="server" visible="false">
                            <td class="adminTitle">
                                SE name:
                            </td>
                            <td class="adminData">
                                <asp:TextBox ID="txtSEName" runat="server" CssClass="adminInput"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
            <ajaxToolkit:TabPanel runat="server" ID="pnlProductMappings" HeaderText="Products">
                <ContentTemplate>
                    <table class="adminContent">
                        <tr>
                            <td width="100%">
                                <asp:GridView ID="gvProductMappings" runat="server" AutoGenerateColumns="false" Width="100%">
                                    <Columns>
                                        <asp:TemplateField HeaderText="Product" ItemStyle-Width="60%">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="cbProductInfo" runat="server" Text='<%#Server.HtmlEncode(Eval("ProductInfo").ToString()) %>'
                                                    Checked='<%# Eval("IsMapped") %>' />
                                                <asp:HiddenField ID="hfProductID" runat="server" Value='<%# Eval("ProductID") %>' />
                                                <asp:HiddenField ID="hfProductManufacturerID" runat="server" Value='<%# Eval("ProductManufacturerID") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="View" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="13%"
                                            ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <a href='ProductDetails.aspx?ProductID=<%# Eval("ProductID") %>'>View</a>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Featured Product" HeaderStyle-HorizontalAlign="Center"
                                            ItemStyle-Width="13%" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="cbFeatured" runat="server" Checked='<%# Eval("IsFeatured") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Display order" HeaderStyle-HorizontalAlign="Center"
                                            ItemStyle-Width="13%" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <nopCommerce:NumericTextBox runat="server" CssClass="adminInput" Width="50px" ID="txtDisplayOrder"
                                                    Value='<%# Eval("DisplayOrder") %>' RequiredErrorMessage="Display order is required"
                                                    RangeErrorMessage="The value must be from -99999 to 99999" MinimumValue="-99999"
                                                    MaximumValue="99999"></nopCommerce:NumericTextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </ajaxToolkit:TabPanel>
        </ajaxToolkit:TabContainer>
    </div>
    <table class="adminContent">
        <tr>
            <td class="adminTitle" align="left">
                <asp:Button ID="SaveButton" runat="server" CssClass="adminButton" Text="Save" OnClick="SaveButton_Click">
                </asp:Button>
            </td>
            <td class="adminData" align="left">
                <asp:Button ID="DeleteButton" runat="server" CssClass="adminButton" Text="Delete"
                    OnClick="DeleteButton_Click" CausesValidation="false"></asp:Button>
                <ajaxToolkit:ConfirmButtonExtender ID="ConfirmDeleteButtonExtender" runat="server"
                    TargetControlID="DeleteButton" DisplayModalPopupID="ModalPopupExtenderDelete" />
                <br />
                <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderDelete" runat="server" TargetControlID="DeleteButton"
                    PopupControlID="pnlDeletePopup" OkControlID="deleteButtonOk" CancelControlID="deleteButtonCancel"
                    BackgroundCssClass="modalBackground" />
                <asp:Panel ID="pnlDeletePopup" runat="server" Style="display: none; width: 250px;
                    background-color: White; border-width: 2px; border-color: Black; border-style: solid;
                    padding: 20px;">
                    <div style="text-align: center;">
                        Are you sure?
                        <br />
                        <br />
                        <asp:Button ID="deleteButtonOk" runat="server" Text="OK" CssClass="adminButton" CausesValidation="false" />
                        <asp:Button ID="deleteButtonCancel" runat="server" Text="Cancel" CssClass="adminButton"
                            CausesValidation="false" />
                    </div>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>
